import React, { Component } from "react";
import { Card, Icon, Input, Checkbox, Button, Table } from "antd";
import LinkButton from "../../../components/link-button/index";
class newdetail extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  render() {
    const dataSource = [
      {
        key: "1",
        name: "ecs-798",
        age: "-",
        address: "Linux",
      },
    ];

    const columns = [
      {
        title: "服务器",
        dataIndex: "name",
        key: "name",
      },
      {
        title: "ip地址",
        dataIndex: "age",
        key: "age",
      },
      {
        title: "系统",
        dataIndex: "address",
        key: "address",
      },
      {
        title: "操作",
        render: () => (
          <div>
            <LinkButton style={{ color: "red" }}>删除</LinkButton>
          </div>
        ),
      },
    ];

    const title = (
      <div>
        <Icon type="arrow-left" onClick={() => this.props.history.goBack()} />{" "}
        &nbsp;&nbsp;
        <span>创建策略</span>
      </div>
    );
    const title1 = <Button type="primary">添加服务器</Button>;
    return (
      <Card title={title}>
        <div>
          <Card title="基本信息">
            <div>
              <span>策略名称：</span>
              <Input style={{ width: 200 }} />
            </div>
            <div style={{ marginTop: 20 }}>
              <span>
                智能学习天数&nbsp;
                <Icon type="question" />
              </span>
              &nbsp;&nbsp;&nbsp;&nbsp;
              <span>
                <Checkbox />
                &nbsp; 7天
                <Checkbox />
                &nbsp; 15天
                <Checkbox />
                &nbsp; 30天
              </span>
            </div>
          </Card>
          <Card title={title1}>
            <Table dataSource={dataSource} columns={columns} />
          </Card>
          <div>
            <Button>创建并学习</Button>&nbsp;&nbsp;
            <Button>取消</Button>
          </div>
        </div>
      </Card>
    );
  }
}

export default newdetail;
